<template>
	<view class="setting">
		<u-button class="logout-btn" type="primary" shape="square" @click="logout">退出登录</u-button>
	</view>
</template>

<script>
	import {
		removeToken
	} from '../../utils/auth'
	import { toast } from '../../utils/common'
	export default {
		data() {
			return {

			}
		},
		methods: {
			logout() {
				removeToken()
				toast("退出成功")
				setTimeout(()=>{
					
					uni.switchTab({
						url: "/pages/index/index"
					})
				},500)
			}
		}
	}
</script>

<style scoped lang="scss">
	.setting {
		width: 90%;
		margin: 5%;

		.logout-btn {
			margin: 40rpx;
			width: calc(100% - 80rpx);
		}
	}
</style>